package com.mastercard.labs

import static org.junit.Assert.*
import org.junit.*

class TransactionServiceTests {
	def transactionService
	
    @Before
    void setUp() {
        // Setup logic here
    }

    @After
    void tearDown() {
        // Tear down logic here
    }

    @Test
    void testGetCardTransactions() {
        Calendar cal = Calendar.getInstance()
		Date today = cal.getTime()
		cal.add(Calendar.YEAR, -1)
		Date lastyear = cal.getTime()
		
		def card = Card.findByNumber("5606952959453580")
		def transactions = transactionService.getCardTransactions(card, lastyear, today)
		for (Transaction txn in transactions) {
			assertTrue (txn.card.number.equals(card.number))
		}
    }
	
	@Test
	void testGetSpending() {
		
	}
	
	@Test
	void testUserTransactions() {
		
	}
	
	@Test
	void testGetTopCardSpendingSummary() {
		
	}
}
